package com.mybatis.moudles.mybatis.controller;

import com.mybatis.moudles.mybatis.model.Student;
import com.mybatis.moudles.mybatis.service.IndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping(path="/yidiantest/index")
@RestController
@Api(value="/",description="indexcontroller")
public class IndexController {

    @Resource
    private IndexService indexService;

    @ApiOperation(value="通过这个方法可以获取什么呢",httpMethod = "GET")
    @RequestMapping(value="/getIndex",method = RequestMethod.GET)
    public List<Student> getIndex(){
       return indexService.getAll();
    }
}
